package com.cays.myresearch.entity;


import java.text.SimpleDateFormat;
import java.util.Date;

public class Student extends Person{
  private String school;
  private String gender;
  private String phone;
  private String professional;
  public String getSchool() {
    return school;
  }
  public void setSchool(String school) {
    this.school = school;
  }
  public String getGender() {
    return gender;
  }
  public void setGender(String gender) {
    this.gender = gender;
  }
  public String getPhone() {
    return phone;
  }
  public void setPhone(String phone) {
    this.phone = phone;
  }
  public String getProfessional() {
    return professional;
  }

  public void setProfessional(String professional) {
    this.professional = professional;
  }


  public Question issueQuestion(String title,String content){
    if (name.isEmpty())return null;
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
    String time=df.format(new Date());// new Date()为获取当前系统时间
    Question question=new Question(title,name,content,time,0,0);
    return question;
  }
  public boolean editQuestion(){
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
    String time=df.format(new Date());// new Date()为获取当前系统时间
    return false;
  }
  public boolean deleteQuestion(){
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
    String time=df.format(new Date());// new Date()为获取当前系统时间
    return false;
  }
  public ProjectsAttend attentProject(Projects projects){
    ProjectsAttend attend=new ProjectsAttend();
    attend.setProjectname(projects.getTitle());
    attend.setIdentify(projects.getTime());
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
    String time=df.format(new Date());// new Date()为获取当前系统时间
    attend.setName(name);attend.setTime(time);
    return attend;
  }
  @Override
  public String toString() {
    return "(school, gender, phone, professional, nam, nick"+
            ", password, time) values (?,?,?,?,?,?,?,?)";
  }
}
